package main

import (
	"bytes"
	"encoding/binary"
	"fmt"
)

func main() {
	mysqlErrorByteOrder()
}

func mysqlErrorByteOrder() {
	e := []byte{255, 40, 4, 35}
	u := binary.LittleEndian.Uint16(e[1:3])
	fmt.Println(u)
}

func test() {
	ioTest := bytes.NewBuffer(make([]byte, 0, 1024))
	_ = binary.Write(ioTest, binary.LittleEndian, uint32(10))
	fmt.Println(ioTest.Next(2))

	var t []byte = make([]byte, 4)
	binary.LittleEndian.PutUint16(t, 1024)
	fmt.Println(t)
	u := binary.LittleEndian.Uint16(t)
	fmt.Println(u)
}
